package apple.p7;

/**
 * @author Lenovo
 */
public class JavaStringSplitEmp {
    public static void main(String[] args){

        String str = "www-runoff-com";
        String[] temp;
        String delimeter = "-";
        temp = str.split(delimeter);
        for (String s : temp) {
            System.out.println(s);
            System.out.println();
        }

        System.out.println("------java for each循环输出的方法-----");
        String str1 = "www.runoff.com";
        String[] temp1;
        String delimeter1 = "\\.";
        temp1 = str1.split(delimeter1);
        for(String x :  temp1){
            System.out.println(x);
            System.out.println();
        }
    }
}